library live_stream_iframe;

import 'package:flutter/material.dart';

import 'src/facebook.dart';
import 'src/tiktok.dart';
import 'src/youtube.dart';

export 'src/youtube.dart';

enum LiveSourceType { youtube, tiktok, facebook }

class LiveStreamIframe extends StatelessWidget {
  final LiveSourceType type;
  final String url;
  final String bgImgUrl;
  final bool enableChat;
  const LiveStreamIframe(
      {Key? key,
      required this.type,
      required this.url,
      this.bgImgUrl = '',
      this.enableChat = false})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    switch (type) {
      case LiveSourceType.youtube:
        return YoutubeIframe(
          url: url,
        );
      case LiveSourceType.facebook:
        return FacebookIframe(
          url: url,
        );
      case LiveSourceType.tiktok:
        return TiktokIframe(
          url: url,
        );
      default:
    }
    return Container();
  }
}
